package com.cskaoyan.weixin.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.weixin.bean.catalog.CatalogListVO;
import com.cskaoyan.weixin.service.CatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("wx/catalog")
public class CatalogController {

    @Autowired
    CatalogService catalogService;

    @RequestMapping("index")
    public BaseRespVo catalogIndex(){
        CatalogListVO catalogListVO = catalogService.queryCatalogIndex();
        return BaseRespVo.ok(catalogListVO);
    }

    @RequestMapping("current")
    public BaseRespVo currentCatalog(Integer id){
        CatalogListVO catalogListVO = catalogService.queryCurrentCategory(id);
        return BaseRespVo.ok(catalogListVO);
    }
}
